Networks are used to transfer voice, video, and data between various network devices. Network devices such as switches are located within networks to direct the transfer of network traffic between the various network devices. Network traffic is typically bursty in nature and in order to compensate for network traffic bursts, memory buffers have been incorporated into switch designs. Memory buffers allow a switch to temporarily store packets when an incoming data rate is higher than an outgoing data rate. When more than one buffer has packets that are contending for the same output, some packets are required to wait in the buffers and some mechanism is needed to determine how packet contention is resolved.
In order to resolve contention and provide a higher QoS to a network switch, two different buffer management schemes, priority queuing and weighted fair queuing, are known. In the priority queuing scheme, contending queues are assigned different priorities and packets are forwarded from the queues in strict priority order. For example, referring to FIG. 1, four queues A, B, C, and D buffer packets that are contending for the same output 20 that has a finite bandwidth. To resolve the contention, the queues are assigned different priorities such as first, second, third, and fourth priority. Packets are similarly prioritized and queued according to their priority. The queued packets are forwarded to the output in priority order such that all packets from higher priority queues are forwarded before any packets from lower priority queues. While priority queuing works well when there is contention between queues, the higher priority packets are forwarded at the expense of lower priority packets. When higher priority packets consume the majority of the finite output bandwidth, the lower priority packets are starved of bandwidth and can back up through the switch architecture, potentially increasing latency to the point where packets are dropped. Dropping a few packets from a transfer may require an entire stream of packets to be retransmitted, practically defeating the benefits gained from prioritizing the contending queues in the first place.
In the weighted fair queuing scheme, contending queues are assigned weights and packets are forwarded from the queues in proportion to the weights assigned to each queue. For example, referring to FIG. 2, four queues A, B, C, and D buffer packets that are contending for the same finite bandwidth output 30. To resolve contention, each queue is assigned a percentage, or weight, that represents the amount of bandwidth that is reserved for that queue. If the total available bandwidth of the output were 100 bytes per second, then with queue weights assigned as 20%, 25%, 15%, and 40%, queue A would forward 20 bytes per second to the output, queue B would forward 25 bytes per second to the output, queue C would forward 15 bytes per second to the output, and queue D would forward 40 bytes per second to the output, with each portion being forwarded every second.
While the weighted fair queuing scheme works well for preventing the problem of starvation that occurs in priority queuing and for establishing a maximum flow rate for each queue, output bandwidth is often wasted when one of the queues does not contain packets for forwarding to the output. Bandwidth is wasted because the percentage of the output bandwidth reserved for the particular queue is reserved whether or not there are packets waiting. If an attempt is made to distribute the excess bandwidth, under the weighted fair queuing scheme, there is no obvious way to distribute the excess bandwidth between the queues because the queues do not have any assigned priority relative to one another.
An additional disadvantage of weighted fair queuing is that the bandwidth limits are not flexible and therefore will not adjust to variations in traffic patterns. It is hard to predict where the stringent bandwidth limits should be set for optimum network performance, especially when traffic patterns are constantly changing. Further, setting bandwidth limits requires precise tuning by a network administrator.
In addition to the disadvantages of queue starvation and wasted bandwidth that result from the priority and weighted fair queuing schemes, prior art switches implement the priority and weighted fair queuing schemes utilizing general purpose central processing units (CPUs) in conjunction with application-specific software. Although software applications are generally easier to develop and more flexible to update than logic embedded into application-specific integrated circuits (ASICs), operations performed in software typically take more time and have greater overhead relative to logic that is embedded into ASICs. As bandwidth requirements for networks increase, the speed with which contending packets are released from buffers is of greater concern.
In view of the above-stated disadvantages of the prior art, what is needed is a way to avoid the starvation of prioritized queues while logically distributing unused bandwidth at speeds required by, for example, gigabit ethernet networks.